diff --git a/bluetooth/Android.bp b/bluetooth/Android.bp
deleted file mode 100644
index 79fbcfb..0000000
--- a/bluetooth/Android.bp
+++ /dev/null
@@ -1,54 +0,0 @@
-//
-// Copyright (C) 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package {
-    // See: http://go/android-license-faq
-    // A large-scale-change added 'default_applicable_licenses' to import
-    // all of the 'license_kinds' from "device_linaro_hikey_license"
-    // to get the below license kinds:
-    //   SPDX-license-identifier-Apache-2.0
-    default_applicable_licenses: ["device_linaro_hikey_license"],
-}
-
-cc_binary {
-    name: "android.hardware.bluetooth@1.0-service.hikey",
-    proprietary: true,
-    relative_install_path: "hw",
-    srcs: [
-        "async_fd_watcher.cc",
-        "bluetooth_hci.cc",
-        "h4_protocol.cc",
-        "hci_packetizer.cc",
-        "hci_protocol.cc",
-        "service.cc",
-    ],
-    cflags: [
-        "-Wall",
-        "-Werror",
-        "-Wno-error=unused-const-variable",
-        "-Wno-error=unused-function",
-        "-Wno-error=unused-lambda-capture",
-    ],
-    shared_libs: [
-        "android.hardware.bluetooth@1.0",
-        "libbase",
-        "libcutils",
-        "libhardware",
-        "libhidlbase",
-        "liblog",
-        "libutils",
-    ],
-    init_rc: ["android.hardware.bluetooth@1.0-service.hikey.rc"],
-}
diff --git a/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc b/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc
deleted file mode 100644
index 6f31efd..0000000
--- a/bluetooth/android.hardware.bluetooth@1.0-service.hikey.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service bluetooth-1-0 /vendor/bin/hw/android.hardware.bluetooth@1.0-service.hikey
-    class hal
-    user bluetooth
-    group bluetooth
diff --git a/bluetooth/async_fd_watcher.cc b/bluetooth/async_fd_watcher.cc
deleted file mode 100644
index c4470d0..0000000
--- a/bluetooth/async_fd_watcher.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-//
-// Copyright 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "async_fd_watcher.h"
-
-#include <algorithm>
-#include <atomic>
-#include <condition_variable>
-#include <map>
-#include <mutex>
-#include <thread>
-#include <vector>
-#include "fcntl.h"
-#include "sys/select.h"
-#include "unistd.h"
-
-static const int INVALID_FD = -1;
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace async {
-
-int AsyncFdWatcher::WatchFdForNonBlockingReads(
-    int file_descriptor, const ReadCallback& on_read_fd_ready_callback) {
-  // Add file descriptor and callback
-  {
-    std::unique_lock<std::mutex> guard(internal_mutex_);
-    watched_fds_[file_descriptor] = on_read_fd_ready_callback;
-  }
-
-  // Start the thread if not started yet
-  return tryStartThread();
-}
-
-int AsyncFdWatcher::ConfigureTimeout(
-    const std::chrono::milliseconds timeout,
-    const TimeoutCallback& on_timeout_callback) {
-  // Add timeout and callback
-  {
-    std::unique_lock<std::mutex> guard(timeout_mutex_);
-    timeout_cb_ = on_timeout_callback;
-    timeout_ms_ = timeout;
-  }
-
-  notifyThread();
-  return 0;
-}
-
-void AsyncFdWatcher::StopWatchingFileDescriptors() { stopThread(); }
-
-AsyncFdWatcher::~AsyncFdWatcher() {}
-
-// Make sure to call this with at least one file descriptor ready to be
-// watched upon or the thread routine will return immediately
-int AsyncFdWatcher::tryStartThread() {
-  if (std::atomic_exchange(&running_, true)) return 0;
-
-  // Set up the communication channel
-  int pipe_fds[2];
-  if (pipe2(pipe_fds, O_NONBLOCK)) return -1;
-
-  notification_listen_fd_ = pipe_fds[0];
-  notification_write_fd_ = pipe_fds[1];
-
-  thread_ = std::thread([this]() { ThreadRoutine(); });
-  if (!thread_.joinable()) return -1;
-
-  return 0;
-}
-
-int AsyncFdWatcher::stopThread() {
-  if (!std::atomic_exchange(&running_, false)) return 0;
-
-  notifyThread();
-  if (std::this_thread::get_id() != thread_.get_id()) {
-    thread_.join();
-  }
-
-  {
-    std::unique_lock<std::mutex> guard(internal_mutex_);
-    watched_fds_.clear();
-  }
-
-  {
-    std::unique_lock<std::mutex> guard(timeout_mutex_);
-    timeout_cb_ = nullptr;
-  }
-
-  return 0;
-}
-
-int AsyncFdWatcher::notifyThread() {
-  uint8_t buffer[] = {0};
-  if (TEMP_FAILURE_RETRY(write(notification_write_fd_, &buffer, 1)) < 0) {
-    return -1;
-  }
-  return 0;
-}
-
-void AsyncFdWatcher::ThreadRoutine() {
-  while (running_) {
-    fd_set read_fds;
-    FD_ZERO(&read_fds);
-    FD_SET(notification_listen_fd_, &read_fds);
-    int max_read_fd = INVALID_FD;
-    for (auto& it : watched_fds_) {
-      FD_SET(it.first, &read_fds);
-      max_read_fd = std::max(max_read_fd, it.first);
-    }
-
-    struct timeval timeout;
-    struct timeval* timeout_ptr = NULL;
-    if (timeout_ms_ > std::chrono::milliseconds(0)) {
-      timeout.tv_sec = timeout_ms_.count() / 1000;
-      timeout.tv_usec = (timeout_ms_.count() % 1000) * 1000;
-      timeout_ptr = &timeout;
-    }
-
-    // Wait until there is data available to read on some FD.
-    int nfds = std::max(notification_listen_fd_, max_read_fd);
-    int retval = select(nfds + 1, &read_fds, NULL, NULL, timeout_ptr);
-
-    // There was some error.
-    if (retval < 0) continue;
-
-    // Timeout.
-    if (retval == 0) {
-      // Allow the timeout callback to modify the timeout.
-      TimeoutCallback saved_cb;
-      {
-        std::unique_lock<std::mutex> guard(timeout_mutex_);
-        if (timeout_ms_ > std::chrono::milliseconds(0)) saved_cb = timeout_cb_;
-      }
-      if (saved_cb != nullptr) saved_cb();
-      continue;
-    }
-
-    // Read data from the notification FD.
-    if (FD_ISSET(notification_listen_fd_, &read_fds)) {
-      char buffer[] = {0};
-      TEMP_FAILURE_RETRY(read(notification_listen_fd_, buffer, 1));
-      continue;
-    }
-
-    // Invoke the data ready callbacks if appropriate.
-    std::vector<decltype(watched_fds_)::value_type> saved_callbacks;
-    {
-      std::unique_lock<std::mutex> guard(internal_mutex_);
-      for (auto& it : watched_fds_) {
-        if (FD_ISSET(it.first, &read_fds)) {
-          saved_callbacks.push_back(it);
-        }
-      }
-    }
-
-    for (auto& it : saved_callbacks) {
-      if (it.second) {
-        it.second(it.first);
-      }
-    }
-  }
-}
-
-}  // namespace async
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/async_fd_watcher.h b/bluetooth/async_fd_watcher.h
deleted file mode 100644
index b51f921..0000000
--- a/bluetooth/async_fd_watcher.h
+++ /dev/null
@@ -1,66 +0,0 @@
-//
-// Copyright 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <map>
-#include <mutex>
-#include <thread>
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace async {
-
-using ReadCallback = std::function<void(int)>;
-using TimeoutCallback = std::function<void(void)>;
-
-class AsyncFdWatcher {
- public:
-  AsyncFdWatcher() = default;
-  ~AsyncFdWatcher();
-
-  int WatchFdForNonBlockingReads(int file_descriptor,
-                                 const ReadCallback& on_read_fd_ready_callback);
-  int ConfigureTimeout(const std::chrono::milliseconds timeout,
-                       const TimeoutCallback& on_timeout_callback);
-  void StopWatchingFileDescriptors();
-
- private:
-  AsyncFdWatcher(const AsyncFdWatcher&) = delete;
-  AsyncFdWatcher& operator=(const AsyncFdWatcher&) = delete;
-
-  int tryStartThread();
-  int stopThread();
-  int notifyThread();
-  void ThreadRoutine();
-
-  std::atomic_bool running_{false};
-  std::thread thread_;
-  std::mutex internal_mutex_;
-  std::mutex timeout_mutex_;
-
-  std::map<int, ReadCallback> watched_fds_;
-  int notification_listen_fd_;
-  int notification_write_fd_;
-  TimeoutCallback timeout_cb_;
-  std::chrono::milliseconds timeout_ms_;
-};
-
-}  // namespace async
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/bluetooth_hci.cc b/bluetooth/bluetooth_hci.cc
deleted file mode 100644
index fe2b782..0000000
--- a/bluetooth/bluetooth_hci.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-//
-// Copyright 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#define LOG_TAG "android.hardware.bluetooth@1.0.hikey"
-
-#include "bluetooth_hci.h"
-
-#include <android-base/logging.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#include <unistd.h>
-#include <utils/Log.h>
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace V1_0 {
-namespace hikey {
-
-using android::hardware::hidl_vec;
-
-BluetoothHci::BluetoothHci()
-    : deathRecipient(new BluetoothDeathRecipient(this)) {}
-
-Return<void> BluetoothHci::initialize(
-    const ::android::sp<IBluetoothHciCallbacks>& cb) {
-  ALOGI("BluetoothHci::initialize()");
-
-  hci_tty_fd_ = open("/dev/hci_tty", O_RDWR);
-  if (hci_tty_fd_ < 0) {
-    ALOGE("%s: Can't open hci_tty (%s)", __func__, strerror(errno));
-    cb->initializationComplete(Status::INITIALIZATION_ERROR);
-    return Void();
-  }
-
-  event_cb_ = cb;
-  event_cb_->linkToDeath(deathRecipient, 0);
-
-  hci_ = new hci::H4Protocol(
-      hci_tty_fd_,
-      [cb](const hidl_vec<uint8_t>& packet) { cb->hciEventReceived(packet); },
-      [cb](const hidl_vec<uint8_t>& packet) { cb->aclDataReceived(packet); },
-      [cb](const hidl_vec<uint8_t>& packet) { cb->scoDataReceived(packet); });
-
-  // Use a socket pair to enforce the TI FIONREAD requirement.
-  int sockfd[2];
-  socketpair(AF_LOCAL, SOCK_STREAM, 0, sockfd);
-  int shim_fd = sockfd[0];
-  int for_hci = sockfd[1];
-
-  fd_watcher_.WatchFdForNonBlockingReads(hci_tty_fd_, [this, shim_fd](int fd) {
-    int tty_bytes = 0;
-    if (TEMP_FAILURE_RETRY(ioctl(fd, FIONREAD, &tty_bytes)))
-      ALOGE("%s:FIONREAD %s", __func__, strerror(errno));
-    ALOGV("%s:tty_bytes = %d", __func__, tty_bytes);
-
-    uint8_t* tmp_buffer = new uint8_t[tty_bytes];
-    size_t bytes_read = TEMP_FAILURE_RETRY(read(fd, tmp_buffer, tty_bytes));
-    CHECK(static_cast<int>(bytes_read) == tty_bytes);
-    size_t bytes_written =
-        TEMP_FAILURE_RETRY(write(shim_fd, tmp_buffer, tty_bytes));
-    CHECK(static_cast<int>(bytes_written) == tty_bytes);
-    delete[] tmp_buffer;
-  });
-
-  fd_watcher_.WatchFdForNonBlockingReads(
-      for_hci, [this](int fd) { hci_->OnDataReady(fd); });
-
-  cb->initializationComplete(Status::SUCCESS);
-  return Void();
-}
-
-Return<void> BluetoothHci::close() {
-  ALOGI("BluetoothHci::close()");
-
-  if (hci_tty_fd_ >= 0) {
-    fd_watcher_.StopWatchingFileDescriptors();
-    ::close(hci_tty_fd_);
-    hci_tty_fd_ = -1;
-  }
-
-  event_cb_->unlinkToDeath(deathRecipient);
-
-  if (hci_ != nullptr) {
-    delete hci_;
-    hci_ = nullptr;
-  }
-
-  return Void();
-}
-
-Return<void> BluetoothHci::sendHciCommand(const hidl_vec<uint8_t>& packet) {
-  hci_->Send(HCI_PACKET_TYPE_COMMAND, packet.data(), packet.size());
-  return Void();
-}
-
-Return<void> BluetoothHci::sendAclData(const hidl_vec<uint8_t>& packet) {
-  hci_->Send(HCI_PACKET_TYPE_ACL_DATA, packet.data(), packet.size());
-  return Void();
-}
-
-Return<void> BluetoothHci::sendScoData(const hidl_vec<uint8_t>& packet) {
-  hci_->Send(HCI_PACKET_TYPE_SCO_DATA, packet.data(), packet.size());
-  return Void();
-}
-
-}  // namespace hikey
-}  // namespace V1_0
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/bluetooth_hci.h b/bluetooth/bluetooth_hci.h
deleted file mode 100644
index 2f1015a..0000000
--- a/bluetooth/bluetooth_hci.h
+++ /dev/null
@@ -1,73 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <android/hardware/bluetooth/1.0/IBluetoothHci.h>
-
-#include <hidl/MQDescriptor.h>
-
-#include "async_fd_watcher.h"
-#include "h4_protocol.h"
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace V1_0 {
-namespace hikey {
-
-using ::android::hardware::Return;
-using ::android::hardware::hidl_vec;
-
-struct BluetoothDeathRecipient : hidl_death_recipient {
-  BluetoothDeathRecipient(const sp<IBluetoothHci> hci) : mHci(hci) {}
-
-  virtual void serviceDied(
-      uint64_t /*cookie*/,
-      const wp<::android::hidl::base::V1_0::IBase>& /*who*/) {
-    mHci->close();
-  }
-  sp<IBluetoothHci> mHci;
-};
-
-class BluetoothHci : public IBluetoothHci {
- public:
-  BluetoothHci();
-  Return<void> initialize(
-      const ::android::sp<IBluetoothHciCallbacks>& cb) override;
-  Return<void> sendHciCommand(const hidl_vec<uint8_t>& packet) override;
-  Return<void> sendAclData(const hidl_vec<uint8_t>& packet) override;
-  Return<void> sendScoData(const hidl_vec<uint8_t>& packet) override;
-  Return<void> close() override;
-
-  static void OnPacketReady();
-
- private:
-  ::android::sp<IBluetoothHciCallbacks> event_cb_;
-  int hci_tty_fd_;
-
-  async::AsyncFdWatcher fd_watcher_;
-
-  hci::H4Protocol* hci_;
-
-  ::android::sp<BluetoothDeathRecipient> deathRecipient;
-};
-
-}  // namespace hikey
-}  // namespace V1_0
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/h4_protocol.cc b/bluetooth/h4_protocol.cc
deleted file mode 100644
index 8f24b5e..0000000
--- a/bluetooth/h4_protocol.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "h4_protocol.h"
-
-#define LOG_TAG "android.hardware.bluetooth-hci-h4"
-#include <android-base/logging.h>
-#include <assert.h>
-#include <fcntl.h>
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-size_t H4Protocol::Send(uint8_t type, const uint8_t* data, size_t length) {
-  int rv = WriteSafely(uart_fd_, &type, sizeof(type));
-  if (rv == sizeof(type)) {
-    rv = WriteSafely(uart_fd_, data, length);
-  }
-  return rv;
-}
-
-void H4Protocol::OnPacketReady() {
-  switch (hci_packet_type_) {
-    case HCI_PACKET_TYPE_EVENT:
-      event_cb_(hci_packetizer_.GetPacket());
-      break;
-    case HCI_PACKET_TYPE_ACL_DATA:
-      acl_cb_(hci_packetizer_.GetPacket());
-      break;
-    case HCI_PACKET_TYPE_SCO_DATA:
-      sco_cb_(hci_packetizer_.GetPacket());
-      break;
-    default: {
-      bool bad_packet_type = true;
-      CHECK(!bad_packet_type);
-    }
-  }
-  // Get ready for the next type byte.
-  hci_packet_type_ = HCI_PACKET_TYPE_UNKNOWN;
-}
-
-void H4Protocol::OnDataReady(int fd) {
-  if (hci_packet_type_ == HCI_PACKET_TYPE_UNKNOWN) {
-    uint8_t buffer[1] = {0};
-    size_t bytes_read = TEMP_FAILURE_RETRY(read(fd, buffer, 1));
-    CHECK(bytes_read == 1);
-    hci_packet_type_ = static_cast<HciPacketType>(buffer[0]);
-  } else {
-    hci_packetizer_.OnDataReady(fd, hci_packet_type_);
-  }
-}
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/h4_protocol.h b/bluetooth/h4_protocol.h
deleted file mode 100644
index 67e2b03..0000000
--- a/bluetooth/h4_protocol.h
+++ /dev/null
@@ -1,60 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <hidl/HidlSupport.h>
-
-#include "async_fd_watcher.h"
-#include "hci_internals.h"
-#include "hci_protocol.h"
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-class H4Protocol : public HciProtocol {
- public:
-  H4Protocol(int fd, PacketReadCallback event_cb, PacketReadCallback acl_cb,
-             PacketReadCallback sco_cb)
-      : uart_fd_(fd),
-        event_cb_(event_cb),
-        acl_cb_(acl_cb),
-        sco_cb_(sco_cb),
-        hci_packetizer_([this]() { OnPacketReady(); }) {}
-
-  size_t Send(uint8_t type, const uint8_t* data, size_t length);
-
-  void OnPacketReady();
-
-  void OnDataReady(int fd);
-
- private:
-  int uart_fd_;
-
-  PacketReadCallback event_cb_;
-  PacketReadCallback acl_cb_;
-  PacketReadCallback sco_cb_;
-
-  HciPacketType hci_packet_type_{HCI_PACKET_TYPE_UNKNOWN};
-  hci::HciPacketizer hci_packetizer_;
-};
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/hci_internals.h b/bluetooth/hci_internals.h
deleted file mode 100644
index 1e1f300..0000000
--- a/bluetooth/hci_internals.h
+++ /dev/null
@@ -1,49 +0,0 @@
-//
-// Copyright 2016 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <stdlib.h>
-
-// HCI UART transport packet types (Volume 4, Part A, 2)
-enum HciPacketType {
-  HCI_PACKET_TYPE_UNKNOWN = 0,
-  HCI_PACKET_TYPE_COMMAND = 1,
-  HCI_PACKET_TYPE_ACL_DATA = 2,
-  HCI_PACKET_TYPE_SCO_DATA = 3,
-  HCI_PACKET_TYPE_EVENT = 4
-};
-
-// 2 bytes for opcode, 1 byte for parameter length (Volume 2, Part E, 5.4.1)
-const size_t HCI_COMMAND_PREAMBLE_SIZE = 3;
-const size_t HCI_LENGTH_OFFSET_CMD = 2;
-
-// 2 bytes for handle, 2 bytes for data length (Volume 2, Part E, 5.4.2)
-const size_t HCI_ACL_PREAMBLE_SIZE = 4;
-const size_t HCI_LENGTH_OFFSET_ACL = 2;
-
-// 2 bytes for handle, 1 byte for data length (Volume 2, Part E, 5.4.3)
-const size_t HCI_SCO_PREAMBLE_SIZE = 3;
-const size_t HCI_LENGTH_OFFSET_SCO = 2;
-
-// 1 byte for event code, 1 byte for parameter length (Volume 2, Part E, 5.4.4)
-const size_t HCI_EVENT_PREAMBLE_SIZE = 2;
-const size_t HCI_LENGTH_OFFSET_EVT = 1;
-
-const size_t HCI_PREAMBLE_SIZE_MAX = HCI_ACL_PREAMBLE_SIZE;
-
-// Event codes (Volume 2, Part E, 7.7.14)
-const uint8_t HCI_COMMAND_COMPLETE_EVENT = 0x0E;
diff --git a/bluetooth/hci_packetizer.cc b/bluetooth/hci_packetizer.cc
deleted file mode 100644
index 9549858..0000000
--- a/bluetooth/hci_packetizer.cc
+++ /dev/null
@@ -1,91 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "hci_packetizer.h"
-
-#define LOG_TAG "android.hardware.bluetooth.hci_packetizer"
-#include <android-base/logging.h>
-#include <utils/Log.h>
-
-#include <dlfcn.h>
-#include <fcntl.h>
-
-namespace {
-
-const size_t preamble_size_for_type[] = {
-    0, HCI_COMMAND_PREAMBLE_SIZE, HCI_ACL_PREAMBLE_SIZE, HCI_SCO_PREAMBLE_SIZE,
-    HCI_EVENT_PREAMBLE_SIZE};
-const size_t packet_length_offset_for_type[] = {
-    0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO,
-    HCI_LENGTH_OFFSET_EVT};
-
-size_t HciGetPacketLengthForType(HciPacketType type, const uint8_t* preamble) {
-  size_t offset = packet_length_offset_for_type[type];
-  if (type != HCI_PACKET_TYPE_ACL_DATA) return preamble[offset];
-  return (((preamble[offset + 1]) << 8) | preamble[offset]);
-}
-
-}  // namespace
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-const hidl_vec<uint8_t>& HciPacketizer::GetPacket() const { return packet_; }
-
-void HciPacketizer::OnDataReady(int fd, HciPacketType packet_type) {
-  switch (state_) {
-    case HCI_PREAMBLE: {
-      size_t bytes_read = TEMP_FAILURE_RETRY(
-          read(fd, preamble_ + bytes_read_,
-               preamble_size_for_type[packet_type] - bytes_read_));
-      CHECK(bytes_read > 0);
-      bytes_read_ += bytes_read;
-      if (bytes_read_ == preamble_size_for_type[packet_type]) {
-        size_t packet_length =
-            HciGetPacketLengthForType(packet_type, preamble_);
-        packet_.resize(preamble_size_for_type[packet_type] + packet_length);
-        memcpy(packet_.data(), preamble_, preamble_size_for_type[packet_type]);
-        bytes_remaining_ = packet_length;
-        state_ = HCI_PAYLOAD;
-        bytes_read_ = 0;
-      }
-      break;
-    }
-
-    case HCI_PAYLOAD: {
-      size_t bytes_read = TEMP_FAILURE_RETRY(read(
-          fd,
-          packet_.data() + preamble_size_for_type[packet_type] + bytes_read_,
-          bytes_remaining_));
-      CHECK(bytes_read > 0);
-      bytes_remaining_ -= bytes_read;
-      bytes_read_ += bytes_read;
-      if (bytes_remaining_ == 0) {
-        packet_ready_cb_();
-        state_ = HCI_PREAMBLE;
-        bytes_read_ = 0;
-      }
-      break;
-    }
-  }
-}
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/hci_packetizer.h b/bluetooth/hci_packetizer.h
deleted file mode 100644
index 90579bd..0000000
--- a/bluetooth/hci_packetizer.h
+++ /dev/null
@@ -1,53 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <functional>
-
-#include <hidl/HidlSupport.h>
-
-#include "hci_internals.h"
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-using ::android::hardware::hidl_vec;
-using HciPacketReadyCallback = std::function<void(void)>;
-
-class HciPacketizer {
- public:
-  HciPacketizer(HciPacketReadyCallback packet_cb)
-      : packet_ready_cb_(packet_cb){};
-  void OnDataReady(int fd, HciPacketType packet_type);
-  const hidl_vec<uint8_t>& GetPacket() const;
-
- protected:
-  enum State { HCI_PREAMBLE, HCI_PAYLOAD };
-  State state_{HCI_PREAMBLE};
-  uint8_t preamble_[HCI_PREAMBLE_SIZE_MAX];
-  hidl_vec<uint8_t> packet_;
-  size_t bytes_remaining_{0};
-  size_t bytes_read_{0};
-  HciPacketReadyCallback packet_ready_cb_;
-};
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/hci_protocol.cc b/bluetooth/hci_protocol.cc
deleted file mode 100644
index cd709b4..0000000
--- a/bluetooth/hci_protocol.cc
+++ /dev/null
@@ -1,74 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#include "hci_protocol.h"
-
-#define LOG_TAG "android.hardware.bluetooth-hci-hci_protocol"
-#include <android-base/logging.h>
-#include <assert.h>
-#include <fcntl.h>
-#include <utils/Log.h>
-
-namespace {
-
-const size_t preamble_size_for_type[] = {
-    0, HCI_COMMAND_PREAMBLE_SIZE, HCI_ACL_PREAMBLE_SIZE, HCI_SCO_PREAMBLE_SIZE,
-    HCI_EVENT_PREAMBLE_SIZE};
-const size_t packet_length_offset_for_type[] = {
-    0, HCI_LENGTH_OFFSET_CMD, HCI_LENGTH_OFFSET_ACL, HCI_LENGTH_OFFSET_SCO,
-    HCI_LENGTH_OFFSET_EVT};
-
-size_t HciGetPacketLengthForType(HciPacketType type, const uint8_t* preamble) {
-  size_t offset = packet_length_offset_for_type[type];
-  if (type != HCI_PACKET_TYPE_ACL_DATA) return preamble[offset];
-  return (((preamble[offset + 1]) << 8) | preamble[offset]);
-}
-
-}  // namespace
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-size_t HciProtocol::WriteSafely(int fd, const uint8_t* data, size_t length) {
-  size_t transmitted_length = 0;
-  while (length > 0) {
-    ssize_t ret =
-        TEMP_FAILURE_RETRY(write(fd, data + transmitted_length, length));
-
-    if (ret == -1) {
-      if (errno == EAGAIN) continue;
-      ALOGE("%s error writing to UART (%s)", __func__, strerror(errno));
-      break;
-
-    } else if (ret == 0) {
-      // Nothing written :(
-      ALOGE("%s zero bytes written - something went wrong...", __func__);
-      break;
-    }
-
-    transmitted_length += ret;
-    length -= ret;
-  }
-
-  return transmitted_length;
-}
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/hci_protocol.h b/bluetooth/hci_protocol.h
deleted file mode 100644
index f76cddf..0000000
--- a/bluetooth/hci_protocol.h
+++ /dev/null
@@ -1,48 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <hidl/HidlSupport.h>
-
-#include "hci_internals.h"
-#include "hci_packetizer.h"
-
-namespace android {
-namespace hardware {
-namespace bluetooth {
-namespace hci {
-
-using ::android::hardware::hidl_vec;
-using PacketReadCallback = std::function<void(const hidl_vec<uint8_t>&)>;
-
-// Implementation of HCI protocol bits common to different transports
-class HciProtocol {
- public:
-  HciProtocol() = default;
-  virtual ~HciProtocol(){};
-
-  // Protocol-specific implementation of sending packets.
-  virtual size_t Send(uint8_t type, const uint8_t* data, size_t length) = 0;
-
- protected:
-  static size_t WriteSafely(int fd, const uint8_t* data, size_t length);
-};
-
-}  // namespace hci
-}  // namespace bluetooth
-}  // namespace hardware
-}  // namespace android
diff --git a/bluetooth/service.cc b/bluetooth/service.cc
deleted file mode 100644
index 05920ed..0000000
--- a/bluetooth/service.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-//
-// Copyright 2017 The Android Open Source Project
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#define LOG_TAG "android.hardware.bluetooth@1.0-service.hikey"
-
-#include <android/hardware/bluetooth/1.0/IBluetoothHci.h>
-#include <hidl/HidlSupport.h>
-#include <hidl/HidlTransportSupport.h>
-#include <utils/Log.h>
-
-#include "bluetooth_hci.h"
-
-using ::android::hardware::configureRpcThreadpool;
-using ::android::hardware::bluetooth::V1_0::IBluetoothHci;
-using ::android::hardware::bluetooth::V1_0::hikey::BluetoothHci;
-using ::android::hardware::joinRpcThreadpool;
-using ::android::sp;
-
-int main(int /* argc */, char** /* argv */) {
-  sp<IBluetoothHci> bluetooth = new BluetoothHci;
-  configureRpcThreadpool(1, true);
-  android::status_t status = bluetooth->registerAsService();
-  if (status == android::OK)
-    joinRpcThreadpool();
-  else
-    ALOGE("Could not register as a service!");
-}
diff --git a/device-common.mk b/device-common.mk
index e5506ec..61e5024 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -97,11 +97,7 @@
     android.hardware.graphics.composer@2.1-service \
     android.hardware.graphics.mapper@2.0-impl-2.1 \
 
-ifeq ($(HIKEY_USE_LEGACY_TI_BLUETOOTH), true)
-PRODUCT_PACKAGES += android.hardware.bluetooth@1.0-service.hikey uim
-else
 PRODUCT_PACKAGES += android.hardware.bluetooth@1.1-service.btlinux
-endif
 
 #
 # Power HAL
@@ -215,9 +211,6 @@
         frameworks/native/data/etc/android.hardware.usb.host.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.usb.host.xml \
         frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml
 
-# Include BT modules
-$(call inherit-product, device/linaro/hikey/wpan/ti-wpan-products.mk)
-
 PRODUCT_COPY_FILES += \
         frameworks/native/data/etc/android.hardware.wifi.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.xml \
         frameworks/native/data/etc/android.hardware.wifi.direct.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.wifi.direct.xml \
diff --git a/gralloc/Android.mk b/gralloc/Android.mk
index 20b8f66..947a184 100644
--- a/gralloc/Android.mk
+++ b/gralloc/Android.mk
@@ -54,8 +54,6 @@
 #LOCAL_CFLAGS+= -DMALI_VSYNC_EVENT_REPORT_ENABLE
 
 
-ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true)
 LOCAL_CFLAGS += -DDISABLE_FRAMEBUFFER_HAL
-endif
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/gralloc960/Android.hikey960.mk b/gralloc960/Android.hikey960.mk
index 8b0b1be..57b4f3e 100644
--- a/gralloc960/Android.hikey960.mk
+++ b/gralloc960/Android.hikey960.mk
@@ -52,8 +52,6 @@
 # Vsync backend(not used)
 GRALLOC_VSYNC_BACKEND=default
 
-ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true)
- GRALLOC_USE_ION_DMA_HEAP=1
- GRALLOC_DISABLE_FRAMEBUFFER_HAL=1
-endif
+GRALLOC_USE_ION_DMA_HEAP=1
+GRALLOC_DISABLE_FRAMEBUFFER_HAL=1
 
diff --git a/hikey-common.mk b/hikey-common.mk
index 3df9ba7..bf3bd24 100644
--- a/hikey-common.mk
+++ b/hikey-common.mk
@@ -2,20 +2,12 @@
 TARGET_KERNEL_USE=4.19
 endif
 
-HIKEY_USE_DRM_HWCOMPOSER := false
-
 LOCAL_KERNEL_HOME ?= device/linaro/hikey-kernel/hikey/$(TARGET_KERNEL_USE)
 TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb
 TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi6220-hikey.dtb
 
 PRODUCT_ENFORCE_VINTF_MANIFEST_OVERRIDE := true
 
-ifeq ($(TARGET_KERNEL_USE), 4.4)
-  HIKEY_USE_LEGACY_TI_BLUETOOTH := true
-else
-  HIKEY_USE_LEGACY_TI_BLUETOOTH := false
-  HIKEY_USE_DRM_HWCOMPOSER := true
-endif
 TARGET_FSTAB := fstab.hikey
 
 $(call inherit-product, device/linaro/hikey/hikey/device-hikey.mk)
diff --git a/hikey/device-hikey.mk b/hikey/device-hikey.mk
index cec2e6f..aa202b3 100644
--- a/hikey/device-hikey.mk
+++ b/hikey/device-hikey.mk
@@ -51,9 +51,7 @@
 # Sensors HAL
 PRODUCT_PACKAGES += sensors.hikey
 
-ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true)
-  PRODUCT_PACKAGES += hwcomposer.drm_hikey
-endif
+PRODUCT_PACKAGES += hwcomposer.drm_hikey
 
 # Include mali blobs from ARM
 PRODUCT_PACKAGES += libGLES_mali.so END_USER_LICENCE_AGREEMENT.txt
diff --git a/hikey960.mk b/hikey960.mk
index 243b002..b300bfa 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -5,18 +5,6 @@
 TARGET_PREBUILT_KERNEL := $(LOCAL_KERNEL_HOME)/Image.gz-dtb
 TARGET_PREBUILT_DTB := $(LOCAL_KERNEL_HOME)/hi3660-hikey960.dtb
 
-ifeq ($(TARGET_KERNEL_USE), 4.4)
-  HIKEY_USE_DRM_HWCOMPOSER := false
-  HIKEY_USE_LEGACY_TI_BLUETOOTH := true
-else
-  ifeq ($(TARGET_KERNEL_USE), 4.9)
-    HIKEY_USE_DRM_HWCOMPOSER := false
-  else
-    HIKEY_USE_DRM_HWCOMPOSER := true
-  endif
-  HIKEY_USE_LEGACY_TI_BLUETOOTH := false
-endif
-
 ifndef HIKEY_USES_GKI
   ifeq ($(TARGET_KERNEL_USE), 5.4)
     HIKEY_USES_GKI := true
diff --git a/hikey960/BoardConfig.mk b/hikey960/BoardConfig.mk
index 515cce6..f7deb4c 100644
--- a/hikey960/BoardConfig.mk
+++ b/hikey960/BoardConfig.mk
@@ -16,24 +16,6 @@
 BOARD_KERNEL_CMDLINE += drm_kms_helper.edid_firmware=edid/1920x1080.bin
 endif
 
-# On kernels before 4.19, enable dtb fstab. On kernels >= 4.19, both dtb
-# fstab and android-verity are deprecated, so until we have avb2 support
-# in the bootloader, don't enable either feature. The ramdisk fstab
-# needed for the new mechanism will be installed unconditionally; if dtb
-# fstab is present, it will override it automatically.
-ifneq ($(TARGET_KERNEL_USE),4.19)
-# Enable treble dtb fstab with verity
-ifneq ($(TARGET_ANDROID_VERITY),)
-BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab_v2
-BOARD_KERNEL_CMDLINE += rootwait ro root=/dev/dm-0
-BOARD_KERNEL_CMDLINE += dm=\"system none ro,0 1 android-verity 8:58\"
-BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
-else
-# Enable treble dtb fstab without verity
-BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_enable_android_fstab
-endif
-endif
-
 ifneq ($(TARGET_SENSOR_MEZZANINE),)
 BOARD_KERNEL_CMDLINE += overlay_mgr.overlay_dt_entry=hardware_cfg_$(TARGET_SENSOR_MEZZANINE)
 endif
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index 46ffbe7..d34dc31 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -92,9 +92,7 @@
 
 PRODUCT_PACKAGES += sensors.hikey960
 
-ifeq ($(HIKEY_USE_DRM_HWCOMPOSER), true)
-  PRODUCT_PACKAGES += hwcomposer.drm_hikey960
-endif
+PRODUCT_PACKAGES += hwcomposer.drm_hikey960
 
 ifneq ($(TARGET_NO_RECOVERY),true)
 PRODUCT_COPY_FILES += \
diff --git a/wpan/Android.mk b/wpan/Android.mk
deleted file mode 100644
index edb7b6f..0000000
--- a/wpan/Android.mk
+++ /dev/null
@@ -1 +0,0 @@
-include $(call first-makefiles-under,$(call my-dir))
diff --git a/wpan/README b/wpan/README
deleted file mode 100644
index 3b45293..0000000
--- a/wpan/README
+++ /dev/null
@@ -1,18 +0,0 @@
-wpan.git contains the Bluetooth, FM code by Texas Instruments for
-WiLink connectivity chipsets on OMAP Platforms
-
-Android.mk - Root Makefile calling all subdir makefiles
-bt_sco_app - Command line application to send PCM configuruations to WL12xx chip(optional)
-and connect to BT headset via SCO.
-bt_voice_call_set - Derived from bt_sco_app for Modem purposes.
-fmradio - Stack and Command line application for FM on WiLink chipsets
-fmradio_omap3 - Derived from fmradio (older version) on OMAP3 platforms
-README - This file
-ti_st -
-	kfmapp/ - V4L2 FM application to be used with V4L2 drivers for FM on WL.
-	uim/ - User-Space Initilization Manager for TI Shared Transport Drivers (to be
-	used with kernel version 2.6.32 and below drivers)
-	uim-rfkill/ - Derived from uim/ to be used with K32 and above TI ST drivers.
-	uim-sysfs/ - User-Space Init Manager for TI Shared Transport Drivers (per kernel.org)
-tools -
-        BluetoothSCOApp/ - BT SCO UI App for connect to BT headset via SCO
diff --git a/wpan/ti-wpan-products.mk b/wpan/ti-wpan-products.mk
deleted file mode 100644
index 8e720fb..0000000
--- a/wpan/ti-wpan-products.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-# This file lists the firmware, software that are specific to
-# WiLink connectivity chip on OMAPx platforms.
-
-PRODUCT_PACKAGES += uim
diff --git a/wpan/uim/Android.mk b/wpan/uim/Android.mk
deleted file mode 100644
index a91abdd..0000000
--- a/wpan/uim/Android.mk
+++ /dev/null
@@ -1,15 +0,0 @@
-#Android makefile for uim
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= uim.c
-
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/
-
-LOCAL_MODULE := uim
-LOCAL_LICENSE_KINDS := SPDX-license-identifier-GPL-2.0
-LOCAL_LICENSE_CONDITIONS := restricted
-LOCAL_PROPRIETARY_MODULE := true
-
-include $(BUILD_EXECUTABLE)
diff --git a/wpan/uim/Makefile b/wpan/uim/Makefile
deleted file mode 100644
index 2790e79..0000000
--- a/wpan/uim/Makefile
+++ /dev/null
@@ -1,46 +0,0 @@
-MAKEFLAGS += --no-print-directory
-
-PREFIX ?= /usr
-SBINDIR ?= $(PREFIX)/sbin
-MANDIR ?= $(PREFIX)/share/man
-
-MKDIR ?= mkdir -p
-INSTALL ?= install
-CC ?= "gcc"
-
-CFLAGS ?= -O2 -g
-CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
-
-OBJS = uim.o
-ALL = uim
-
-ifeq ($(V),1)
-Q=
-NQ=true
-else
-Q=@
-NQ=echo
-endif
-
-all: $(ALL)
-
-VERSION_OBJS := $(filter-out version.o, $(OBJS))
-
-%.o: %.c uim.h
-	@$(NQ) ' CC  ' $@
-	$(Q)$(CC) $(CFLAGS) -c -o $@ $<
-
-uim:	$(OBJS)
-	@$(NQ) ' CC  ' uim
-	$(Q)$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o uim
-
-check:
-	$(Q)$(MAKE) all CC="REAL_CC=$(CC) CHECK=\"sparse -Wall\" cgcc"
-
-install: uim
-	@$(NQ) ' INST uim'
-	$(Q)$(MKDIR) $(DESTDIR)$(SBINDIR)
-	$(Q)$(INSTALL) -m 755 -t $(DESTDIR)$(SBINDIR) uim
-
-clean:
-	$(Q)rm -f uim *.o *~ 
diff --git a/wpan/uim/uim.c b/wpan/uim/uim.c
deleted file mode 100644
index 7f78f0c..0000000
--- a/wpan/uim/uim.c
+++ /dev/null
@@ -1,562 +0,0 @@
-/*
- *  User Mode Init manager - For TI shared transport
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program;if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <termios.h>
-#include <poll.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/utsname.h>
-
-#include <unistd.h>
-#include <time.h>
-
-#include "uim.h"
-
-/* Maintains the exit state of UIM*/
-static int exiting;
-static int line_discipline;
-static int dev_fd;
-
-/* BD address as string and a pointer to array of hex bytes */
-char uim_bd_address[BD_ADDR_LEN];
-bdaddr_t *bd_addr;
-
-/* kim Sysfs path */
-static char *sysfs_install_entry = INSTALL_SYSFS_ENTRY;
-static char *sysfs_dev_name = DEV_NAME_SYSFS;
-static char *sysfs_baud_rate = BAUD_RATE_SYSFS;
-static char *sysfs_flow_ctrl = FLOW_CTRL_SYSFS;
-
-/*****************************************************************************/
-#ifdef UIM_DEBUG
-/*  Function to Read the firmware version
- *  module into the system. Currently used for
- *  debugging purpose, whenever the baud rate is changed
- */
-void read_firmware_version(int dev_fd)
-{
-	int index = 0;
-	char resp_buffer[20] = { 0 };
-	unsigned char buffer[] = { 0x01, 0x01, 0x10, 0x00 };
-
-	UIM_START_FUNC();
-	UIM_VER(" wrote %d bytes", (int)write(dev_fd, buffer, 4));
-	UIM_VER(" reading %d bytes", (int)read(dev_fd, resp_buffer, 15));
-
-	for (index = 0; index < 15; index++)
-		UIM_VER(" %x ", resp_buffer[index]);
-
-	printf("\n");
-}
-#endif
-
-void sysfs_entry_fallback(void)
-{
-	sysfs_install_entry = INSTALL_SYSFS_ENTRY_OLD;
-	sysfs_dev_name = DEV_NAME_SYSFS_OLD;
-	sysfs_baud_rate = BAUD_RATE_SYSFS_OLD;
-	sysfs_flow_ctrl = FLOW_CTRL_SYSFS_OLD;
-}
-
-/*****************************************************************************/
-/* Function to read the HCI event from the given file descriptor
- *
- * This will parse the response received and returns error
- * if the required response is not received
- */
-int read_hci_event(int fd, unsigned char *buf, int size)
-{
-	int remain, rd;
-	int count = 0;
-	int reading = 1;
-	int rd_retry_count = 0;
-	struct timespec tm = {0, 50*1000*1000};
-
-	UIM_START_FUNC();
-
-	UIM_VER(" read_hci_event");
-	if (size <= 0)
-		return -1;
-
-	/* The first byte identifies the packet type. For HCI event packets, it
-	 * should be 0x04, so we read until we get to the 0x04. */
-	while (reading) {
-		rd = read(fd, buf, 1);
-		if (rd <= 0 && rd_retry_count++ < 4) {
-			nanosleep(&tm, NULL);
-			continue;
-		} else if (rd_retry_count >= 4) {
-			return -1;
-		}
-
-		if (buf[0] == RESP_PREFIX) {
-			break;
-		}
-	}
-	count++;
-
-	/* The next two bytes are the event code and parameter total length. */
-	while (count < 3) {
-		rd = read(fd, buf + count, 3 - count);
-		if (rd <= 0)
-			return -1;
-		count += rd;
-	}
-
-	/* Now we read the parameters. */
-	if (buf[2] < (size - 3))
-		remain = buf[2];
-	else
-		remain = size - 3;
-
-	while ((count - 3) < remain) {
-		rd = read(fd, buf + count, remain - (count - 3));
-		if (rd <= 0)
-			return -1;
-		count += rd;
-	}
-
-	return count;
-}
-
-/* Function to read the Command complete event
- *
- * This will read the response for the change speed
- * command that was sent to configure the UART speed
- * with the custom baud rate
- */
-static int read_command_complete(int fd, unsigned short opcode)
-{
-	command_complete_t resp;
-
-	UIM_START_FUNC();
-
-	UIM_VER(" Command complete started");
-	if (read_hci_event(fd, (unsigned char *)&resp, sizeof(resp)) < 0) {
-		UIM_ERR("Invalid response");
-		return -1;
-	}
-
-	/* Response should be an event packet */
-	if (resp.uart_prefix != HCI_EVENT_PKT) {
-		UIM_ERR	("Error in response: not an event packet, 0x%02x!",
-			 resp.uart_prefix);
-		return -1;
-	}
-
-	/* Response should be a command complete event */
-	if (resp.hci_hdr.evt != EVT_CMD_COMPLETE) {
-		/* event must be event-complete */
-		UIM_ERR("Error in response: not a cmd-complete event,0x%02x!",
-			 resp.hci_hdr.evt);
-		return -1;
-	}
-
-	if (resp.hci_hdr.plen < 4) {
-		/* plen >= 4 for EVT_CMD_COMPLETE */
-		UIM_ERR("Error in response: plen is not >= 4, but 0x%02x!",
-				resp.hci_hdr.plen);
-		return -1;
-	}
-
-	if (resp.cmd_complete.opcode != (unsigned short)opcode) {
-		UIM_ERR("Error in response: opcode is 0x%04x, not 0x%04x!",
-				resp.cmd_complete.opcode, opcode);
-		return -1;
-	}
-
-	UIM_DBG("Command complete done");
-	return resp.status == 0 ? 0 : -1;
-}
-
-/* Function to set the default baud rate
- *
- * The default baud rate of 115200 is set to the UART from the host side
- * by making a call to this function.This function is also called before
- * making a call to set the custom baud rate
- */
-static int set_baud_rate(int dev_fd)
-{
-	UIM_START_FUNC();
-	struct termios ti;
-
-	tcflush(dev_fd, TCIOFLUSH);
-
-	/* Get the attributes of UART */
-	if (tcgetattr(dev_fd, &ti) < 0) {
-		UIM_ERR(" Can't get port settings");
-		return -1;
-	}
-
-	/* Change the UART attributes before
-	 * setting the default baud rate*/
-	cfmakeraw(&ti);
-
-	ti.c_cflag |= 1;
-	ti.c_cflag |= CRTSCTS;
-
-	/* Set the attributes of UART after making
-	 * the above changes
-	 */
-	tcsetattr(dev_fd, TCSANOW, &ti);
-
-	/* Set the actual default baud rate */
-	cfsetospeed(&ti, B115200);
-	cfsetispeed(&ti, B115200);
-	tcsetattr(dev_fd, TCSANOW, &ti);
-
-	tcflush(dev_fd, TCIOFLUSH);
-	UIM_DBG("set_baud_rate() done");
-
-	return 0;
-}
-
-
-/* Function to set the UART custom baud rate.
- *
- * The UART baud rate has already been
- * set to default value 115200 before calling this function.
- * The baud rate is then changed to custom baud rate by this function*/
-static int set_custom_baud_rate(int dev_fd, int baud_rate, int flow_ctrl)
-{
-	UIM_START_FUNC();
-
-	struct termios ti;
-	struct termios2 ti2;
-
-	tcflush(dev_fd, TCIOFLUSH);
-	/* Get the attributes of UART */
-	if (tcgetattr(dev_fd, &ti) < 0) {
-		UIM_ERR(" Can't get port settings");
-		return -1;
-	}
-
-	/*Set the UART flow control */
-	if (flow_ctrl)
-		ti.c_cflag |= CRTSCTS;
-	else
-		ti.c_cflag &= ~CRTSCTS;
-
-	/*
-	 * Set the parameters associated with the UART
-	 * The change will occur immediately by using TCSANOW
-	 */
-	if (tcsetattr(dev_fd, TCSANOW, &ti) < 0) {
-		UIM_ERR(" Can't set port settings");
-		return -1;
-	}
-
-	tcflush(dev_fd, TCIOFLUSH);
-
-	/*Set the actual baud rate */
-	ioctl(dev_fd, TCGETS2, &ti2);
-	ti2.c_cflag &= ~CBAUD;
-	ti2.c_cflag |= BOTHER;
-	ti2.c_ospeed = baud_rate;
-	ioctl(dev_fd, TCSETS2, &ti2);
-
-	return 0;
-}
-
-/* Function to configure the UART
- * on receiving a notification from the ST KIM driver to install the line
- * discipline, this function does UART configuration necessary for the STK
- */
-int st_uart_config(unsigned char install)
-{
-	int ldisc, len, fd, flow_ctrl;
-	unsigned char buf[UART_DEV_NAME_LEN];
-	uim_speed_change_cmd cmd;
-	char uart_dev_name[UART_DEV_NAME_LEN];
-	unsigned int cust_baud_rate;
-
-	uim_bdaddr_change_cmd addr_cmd;
-
-	UIM_START_FUNC();
-
-	if (install == '1') {
-		memset(buf, 0, UART_DEV_NAME_LEN);
-		fd = open(sysfs_dev_name, O_RDONLY);
-		if (fd < 0) {
-			UIM_ERR("Can't open %s", sysfs_dev_name);
-			return -1;
-		}
-		len = read(fd, buf, UART_DEV_NAME_LEN);
-		if (len < 0) {
-			UIM_ERR("read err (%s)", strerror(errno));
-			close(fd);
-			return len;
-		}
-		sscanf((const char*)buf, "%s", uart_dev_name);
-		close(fd);
-
-		memset(buf, 0, UART_DEV_NAME_LEN);
-		fd = open(sysfs_baud_rate, O_RDONLY);
-		if (fd < 0) {
-			UIM_ERR("Can't open %s", sysfs_baud_rate);
-			return -1;
-		}
-		len = read(fd, buf, UART_DEV_NAME_LEN);
-		if (len < 0) {
-			UIM_ERR("read err (%s)", strerror(errno));
-			close(fd);
-			return len;
-		}
-		close(fd);
-		sscanf((const char*)buf, "%d", &cust_baud_rate);
-
-		memset(buf, 0, UART_DEV_NAME_LEN);
-		fd = open(sysfs_flow_ctrl, O_RDONLY);
-		if (fd < 0) {
-			UIM_ERR("Can't open %s", sysfs_flow_ctrl);
-			close(fd);
-			return -1;
-		}
-		len = read(fd, buf, UART_DEV_NAME_LEN);
-		if (len < 0) {
-			UIM_ERR("read err (%s)", strerror(errno));
-			close(fd);
-			return len;
-		}
-		close(fd);
-		sscanf((const char*)buf, "%d", &flow_ctrl);
-
-		UIM_VER(" signal received, opening %s", uart_dev_name);
-
-		dev_fd = open(uart_dev_name, O_RDWR);
-		if (dev_fd < 0) {
-			UIM_ERR("Can't open %s", uart_dev_name);
-			return -1;
-		}
-
-		/*
-		 * Set only the default baud rate.
-		 * This will set the baud rate to default 115200
-		 */
-		if (set_baud_rate(dev_fd) < 0) {
-			UIM_ERR("set_baudrate() failed");
-			close(dev_fd);
-			return -1;
-		}
-
-		fcntl(dev_fd, F_SETFL,fcntl(dev_fd, F_GETFL) | O_NONBLOCK);
-		/* Set only the custom baud rate */
-		if (cust_baud_rate != 115200) {
-
-			UIM_VER("Setting speed to %d", cust_baud_rate);
-			/* Forming the packet for Change speed command */
-			cmd.uart_prefix = HCI_COMMAND_PKT;
-			cmd.hci_hdr.opcode = HCI_HDR_OPCODE;
-			cmd.hci_hdr.plen = sizeof(unsigned int);
-			cmd.speed = cust_baud_rate;
-
-			/* Writing the change speed command to the UART
-			 * This will change the UART speed at the controller
-			 * side
-			 */
-			len = write(dev_fd, &cmd, sizeof(cmd));
-			if (len < 0) {
-				UIM_ERR("Failed to write speed-set command");
-				close(dev_fd);
-				return -1;
-			}
-
-			/* Read the response for the Change speed command */
-			if (read_command_complete(dev_fd, HCI_HDR_OPCODE) < 0) {
-				close(dev_fd);
-				return -1;
-			}
-
-			UIM_VER("Speed changing to %d, %d", cust_baud_rate, flow_ctrl);
-			/* Set the actual custom baud rate at the host side */
-			if (set_custom_baud_rate(dev_fd, cust_baud_rate, flow_ctrl) < 0) {
-				UIM_ERR("set_custom_baud_rate() failed");
-				close(dev_fd);
-				return -1;
-			}
-
-			/* Set the uim BD address */
-			if (uim_bd_address[0] != 0) {
-
-				memset(&addr_cmd, 0, sizeof(addr_cmd));
-				/* Forming the packet for change BD address command*/
-				addr_cmd.uart_prefix = HCI_COMMAND_PKT;
-				addr_cmd.hci_hdr.opcode = WRITE_BD_ADDR_OPCODE;
-				addr_cmd.hci_hdr.plen = sizeof(bdaddr_t);
-				memcpy(&addr_cmd.addr, bd_addr, sizeof(bdaddr_t));
-
-				/* Writing the change BD address command to the UART
-				 * This will change the change BD address  at the controller
-				 * side
-				 */
-				len = write(dev_fd, &addr_cmd, sizeof(addr_cmd));
-				if (len < 0) {
-					UIM_ERR("Failed to write BD address command");
-					close(dev_fd);
-					return -1;
-				}
-
-				/* Read the response for the change BD address command */
-				if (read_command_complete(dev_fd, WRITE_BD_ADDR_OPCODE) < 0) {
-					close(dev_fd);
-					return -1;
-				}
-				UIM_VER("BD address changed to %s", uim_bd_address);
-			}
-#ifdef UIM_DEBUG
-			read_firmware_version(dev_fd);
-#endif
-		}
-
-		/* After the UART speed has been changed, the IOCTL is
-		 * is called to set the line discipline to N_TI_WL
-		 */
-		ldisc = N_TI_WL;
-		if (ioctl(dev_fd, TIOCSETD, &ldisc) < 0) {
-			UIM_ERR(" Can't set line discipline");
-			close(dev_fd);
-			return -1;
-		}
-		UIM_DBG("Installed N_TI_WL Line displine");
-	}
-	else {
-		UIM_DBG("Un-Installed N_TI_WL Line displine");
-		/* UNINSTALL_N_TI_WL - When the Signal is received from KIM */
-		/* closing UART fd */
-		close(dev_fd);
-	}
-	return 0;
-}
-
-/* Function to convert the BD address from ascii to hex value */
-bdaddr_t *strtoba(const char *str)
-{
-        const char *ptr = str;
-        int i;
-
-        uint8_t *ba = malloc(sizeof(bdaddr_t));
-        if (!ba)
-                return NULL;
-
-        for (i = 0; i < 6; i++) {
-                ba[i] = (uint8_t) strtol(ptr, NULL, 16);
-                if (i != 5 && !(ptr = strchr(ptr, ':')))
-                        ptr = ":00:00:00:00:00";
-                ptr++;
-        }
-
-        return (bdaddr_t *) ba;
-}
-
-/*****************************************************************************/
-int main(int argc, char *argv[])
-{
-	int st_fd, err,trials;
-	unsigned char install;
-	struct pollfd 	p;
-
-	UIM_START_FUNC();
-	err = 0;
-	trials = 5;
-
-	/* Parse the user input */
-	if ((argc > 2)) {
-		UIM_ERR("Invalid arguements");
-		UIM_ERR("Usage: uim <bd address>");
-		return -1;
-	}
-	if (argc == 2) {
-		if (strlen(argv[2]) != BD_ADDR_LEN) {
-			UIM_ERR("Usage: uim XX:XX:XX:XX:XX:XX");
-			return -1;
-		}
-		/* BD address passed as string in xx:xx:xx:xx:xx:xx format */
-		strncpy(uim_bd_address, argv[2], sizeof(uim_bd_address));
-		bd_addr = strtoba(uim_bd_address);
-	}
-
-	line_discipline = N_TI_WL;
-
-	/* sysfs entry may get populated after service is started so we retry if it fails*/
-	while (trials > 0) {
-		st_fd = open(sysfs_install_entry, O_RDONLY);
-		if(st_fd > 0)
-			break;
-		if (trials == 3)
-			sysfs_entry_fallback();
-		else
-			usleep(500000);
-		--trials;
-		}
-	if (st_fd < 0) {
-		UIM_DBG("unable to open %s(%s)", sysfs_install_entry, strerror(errno));
-		return -1;
-	}
-
-RE_POLL:
-	/* read to start proper poll */
-	err = read(st_fd, &install, 1);
-	/* special case where bluetoothd starts before the UIM, and UIM
-	 * needs to turn on bluetooth because of that.
-	 */
-	if ((err > 0) && install == '1') {
-		UIM_DBG("install set previously...");
-		st_uart_config(install);
-	}
-
-	UIM_DBG("begin polling...");
-
-	memset(&p, 0, sizeof(p));
-	p.fd = st_fd;
-	p.events = POLLERR | POLLPRI;
-
-	while (!exiting) {
-		p.revents = 0;
-		err = poll(&p, 1, -1);
-		UIM_DBG("poll broke due to event %d(PRI:%d/ERR:%d)\n", p.revents, POLLPRI, POLLERR);
-		if (err < 0 && errno == EINTR)
-			continue;
-		if (err)
-			break;
-	}
-
-	close(st_fd);
-	st_fd = open(sysfs_install_entry, O_RDONLY);
-	if (st_fd < 0) {
-		UIM_DBG("unable to open %s (%s)", sysfs_install_entry, strerror(errno));
-		return -1;
-	}
-
-	if (!exiting)
-	{
-		err = read(st_fd, &install, 1);
-		UIM_DBG("read %c from install \n", install);
-		if (err > 0)
-			st_uart_config(install);
-		goto RE_POLL;
-	}
-
-	close(st_fd);
-	return 0;
-}
diff --git a/wpan/uim/uim.h b/wpan/uim/uim.h
deleted file mode 100644
index dc9c5b1..0000000
--- a/wpan/uim/uim.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *  User Mode Init manager - For shared transport
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program;if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#ifndef UIM_H
-#define UIM_H
-
-/* the line discipline ideally should be coming
- * from tty.h
- */
-#define N_TI_WL 22
-
-/* Paramaters to set the baud rate*/
-#define  FLOW_CTL	0x0001
-#define  ARM_NCCS	19
-
-#ifndef TCGETS2
-#define TCGETS2      _IOR('T',0x2A, struct termios2)
-#endif
-#ifndef TCSETS2
-#define TCSETS2      _IOW('T',0x2B, struct termios2)
-#endif
-
-/*HCI Command and Event information*/
-#define HCI_HDR_OPCODE		0xff36
-#define WRITE_BD_ADDR_OPCODE    0xFC06
-#define RESP_PREFIX		0x04
-#define MAX_TRY			10
-
-/* HCI Packet types */
-#define HCI_COMMAND_PKT		0x01
-#define HCI_EVENT_PKT		0x04
-
-/* HCI command macros*/
-#define HCI_EVENT_HDR_SIZE      2
-#define HCI_COMMAND_HDR_SIZE	3
-#define HCI_COMMAND_HDR_SIZE    3
-
-/* HCI event macros*/
-#define EVT_CMD_COMPLETE_SIZE	3
-#define EVT_CMD_STATUS_SIZE	4
-#define EVT_CMD_COMPLETE	0x0E
-#define EVT_CMD_STATUS		0x0F
-
-/* use it for string lengths and buffers */
-#define UART_DEV_NAME_LEN	32
-/* BD address length in format xx:xx:xx:xx:xx:xx */
-#define BD_ADDR_LEN		17
-
-/* the sysfs entries with device configuration set by
- * shared transport driver
- */
-#define INSTALL_SYSFS_ENTRY "/sys/devices/platform/kim/install"
-#define DEV_NAME_SYSFS "/sys/devices/platform/kim/dev_name"
-#define BAUD_RATE_SYSFS "/sys/devices/platform/kim/baud_rate"
-#define FLOW_CTRL_SYSFS "/sys/devices/platform/kim/flow_cntrl"
-
-#define INSTALL_SYSFS_ENTRY_OLD "/sys/devices/kim/install"
-#define DEV_NAME_SYSFS_OLD "/sys/devices/kim/dev_name"
-#define BAUD_RATE_SYSFS_OLD "/sys/devices/kim/baud_rate"
-#define FLOW_CTRL_SYSFS_OLD "/sys/devices/kim/flow_cntrl"
-
-#define VERBOSE
-/*Debug logs*/
-#define UIM_ERR(fmt, arg...)  printf("uim:"fmt"\n" , ##arg)
-#if defined(UIM_DEBUG)		/* limited debug messages */
-#define UIM_START_FUNC()      printf("uim: Inside %s", __FUNCTION__)
-#define UIM_DBG(fmt, arg...)  printf("uim:"fmt"\n" , ## arg)
-#define UIM_VER(fmt, arg...)
-#elif defined(VERBOSE)		/* very verbose */
-#define UIM_START_FUNC()      printf("uim:@ %s\n", __FUNCTION__)
-#define UIM_DBG(fmt, arg...)  printf("uim:"fmt"\n" , ## arg)
-#define UIM_VER(fmt, arg...)  printf("uim:"fmt"\n" , ## arg)
-#else /* error msgs only */
-#define UIM_START_FUNC()
-#define UIM_DBG(fmt, arg...)
-#define UIM_VER(fmt, arg...)
-#endif
-
-/* HCI command header*/
-typedef struct {
-        uint16_t        opcode;         /* OCF & OGF */
-        uint8_t         plen;
-} __attribute__ ((packed))      hci_command_hdr;
-
-/* HCI event header*/
-typedef struct {
-        uint8_t         evt;
-        uint8_t         plen;
-} __attribute__ ((packed))      hci_event_hdr;
-
-/* HCI command complete event*/
-typedef struct {
-        uint8_t         ncmd;
-        uint16_t        opcode;
-} __attribute__ ((packed)) evt_cmd_complete;
-
-/* HCI event status*/
-typedef struct {
-        uint8_t         status;
-        uint8_t         ncmd;
-        uint16_t        opcode;
-} __attribute__ ((packed)) evt_cmd_status;
-
-/* HCI Event structure to set the cusrom baud rate*/
-typedef struct {
-	uint8_t uart_prefix;
-	hci_event_hdr hci_hdr;
-	evt_cmd_complete cmd_complete;
-	uint8_t status;
-	uint8_t data[16];
-} __attribute__ ((packed)) command_complete_t;
-
-/* HCI Command structure to set the cusrom baud rate*/
-typedef struct {
-	uint8_t uart_prefix;
-	hci_command_hdr hci_hdr;
-	uint32_t speed;
-} __attribute__ ((packed)) uim_speed_change_cmd;
-
-/* BD address structure to set the uim BD address*/
-typedef struct {
-        unsigned char b[6];
-} __attribute__((packed)) bdaddr_t;
-
-/* HCI Command structure to set the uim BD address*/
-typedef struct {
-        uint8_t uart_prefix;
-        hci_command_hdr hci_hdr;
-        bdaddr_t addr;
-} __attribute__ ((packed)) uim_bdaddr_change_cmd;\
-
-#endif /* UIM_H */
